package File;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class demo08 {
    public static void main(String[] args) throws IOException {
        try (InputStream inputStream=new FileInputStream("./maybe.text")){
            while(true){
//                //一个一个字节读
//                int m=inputStream.read();
//                if(m==-1){
//                    break;
//                }
//                System.out.printf("0x%x",m);
//                System.out.println();
//                byte[] data=new byte[1024];
                byte[] data=new byte[3];
                int n=inputStream.read(data);
                if(n==-1){
                    break;
                }
                System.out.println(n);
                for(int i=0;i<n;i++){
                    System.out.printf("0x%x",data[i]);
                    System.out.println();
                }

            }

        }
    }
}
